/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *
 * Copyright 2009 - 2012 Luca Mingardi.
 *
 * This file is part of jeeObserver.
 *
 * JeeObserver is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * JeeObserver is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */
package jeeobserver;

import java.io.Serializable;

/**
 * The Class Observer.
 *
 * @author Luca Mingardi
 * @version 4.0
 */
public abstract class Observer implements Serializable {

	 private static final long serialVersionUID = 40L;

	 /** The running. */
	 private final String context;

	 /** The running. */
	 private transient boolean running;

	 public Observer() {
			this.context = JeeObserverContext.getInstance().getContext();
	 }

	 public Observer(String context) {
			this.context = context;
	 }

	 public String getContext() {
			return context;
	 }

	 /**
	  * Checks if is running.
	  *
	  * @return true, if is running
	  */
	 protected boolean isRunning() {
			return this.running;
	 }

	 /**
	  * Sets the running.
	  *
	  * @param running the new running
	  */
	 protected void setRunning(boolean running) {
			this.running = running;
	 }
}
